﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace GotLyrics
{
#if DEBUG // Designer doesn't likes abstract classes
    public class PropertyPageControl : UserControl
#else
    public abstract class PropertyPageControl : UserControl
#endif
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="PropertyPageControl"/> class.
        /// </summary>
        public PropertyPageControl()
            : base()
        {
            //GotLyricsMainForm.FileSelectionChange += new EventHandler<AudioFileSelectionChangeEventArgs>(FileSelectionChange);
        }

        /*private List<LyricGrabberContext> _selection;
        /// <summary>
        /// Gets the selection of audio files. This can be <c>null</c>.
        /// </summary>
        /// <value>The selection.</value>
        protected List<LyricGrabberContext> Selection
        {
            get { return _selection; }
        }*/

#if DEBUG
        public virtual void ReflectSelection()
        {
            throw (new NotImplementedException("Missing override or base is called."));
        }
#else
        /// <summary>
        /// Updates the properties. This is mostly called when the file selection has changed.
        /// </summary>
        public abstract void ReflectSelection();
#endif
        /// <summary>
        /// Handles a selection change.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="GotLyrics.FileSelectionChangeEventArgs"/> instance containing the event data.</param>
        protected virtual void FileSelectionChange(object sender, AudioFileSelectionChangeEventArgs e)
        {
            //_selection = e.Selection;
            ReflectSelection();
        }
    }
}
